//
//  create_enc_service_reply.cpp
// ~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2013-2014 Razvan Coca (razvan dot coca at  gmail dot com)
// This is mostly generated code. Generator is distributed under GPL. Edit it to suit your needs.
// 



#include "create_enc_service_reply.hpp"
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <boost/asio.hpp>

#include "patterns/command.hpp"
#include "patterns/handlers.hpp"

#include "logging/logging.hpp"

namespace pcmd=patterns::command;
namespace phdl=patterns::handlers;
namespace ba=boost::asio;
namespace bs=boost::system;
namespace bt=boost::posix_time;

#include "components/defs/util_types.hpp"
#include "components/defs/server_processor.hpp"
#include "components/protocol/create_enc_service_reply.hpp"
namespace components{
namespace protocol{


bool create_enc_service_reply::cancel()
{

    try{
        bool retcode=true;
        LOG(WARNING)<<name_<<"::"<<__FUNCTION__;
        return retcode;
    }
    catch(std::exception &e){
        LOG(WARNING)<<name_<<"::"<<__FUNCTION__<<":"<<e.what();
        return false;
    }


}

boost::shared_ptr<create_enc_service_reply> create_enc_service_reply::create(ba::io_service& ios,crypto_buf_t& iv,crypto_buf_t& key,stats_message_server_processor& message_processor)
{

    return boost::shared_ptr<create_enc_service_reply>(new create_enc_service_reply(ios,iv,key,message_processor));
}

create_enc_service_reply::create_enc_service_reply(ba::io_service& ios,crypto_buf_t& iv,crypto_buf_t& key,stats_message_server_processor& message_processor)
    :ios_(ios), iv_(iv), key_(key), message_processor_(message_processor)
{

    name_=std::string(__FUNCTION__);
    DLOG(INFO)<<name_<<"()";
    if(!aes_service_)
    {
        aes_service_=components::encrypt::aes_service::create(ios_);
        //aes_service_->enc_key(iv_,key_);
        //aes_service_->dec_key(iv_,key_);
    }


}

create_enc_service_reply::~create_enc_service_reply()
{
    DLOG(INFO)<<name_<<"::"<<__FUNCTION__<<std::endl;
}
}//end namespace protocol
}//end namespace components

